package com.wuhao.lib_common.configure;

import android.os.Environment;

import com.wuhao.lib_common.utils.DataStoreUtils;
import com.wuhao.lib_common.utils.NotNullHelper;


/**
 * Created by Mr.Hao on 2017/11/1.
 */

public class HttpConfig {
    //HTTP Status
//    public final static int RESULT_OK = 200;
    public final static int RESULT_OK = 0;
    public final static int RESULT_UNAUTHORIZED = 401;
    public final static int RESULT_FORBIDDEN = 403;
    public final static int RESULT_ERROR = 404;

    /**
     * 正试
     **/
    public final static String BASE_URL = "https://aip.baidubce.com/rest/2.0/";
    public final static String RELEASE_URL_COMPANY = "https://aip.baidubce.com/rest/2.0/";
    public final static String RELEASE_URL_WANGYUHUI = "https://aip.baidubce.com/rest/2.0/";
    public final static String RELEASE_URL_RELEASE = "http://192.168.0.100:8900/";
    public final static String RELEASE_URL_FWTECH = "http://192.168.30.45:8900/";
    public final static String RELEASE_URL_TOKEN = "https://aip.baidubce.com/oauth/2.0/";
    /**
     * 测试
     **/
    private static final String DEBUG_URL = "https://aip.baidubce.com/rest/2.0/";

    private static String TAIL_URL = "/";
    private static String HEAD_URL = "http://";

    public static final String IP = "192.168.0.178";
    public static final int PORT = 4001;

    // 150 MiB
    public static final int DEFAULT_CACHE_SIZE = 150 * 1024 * 1024;
    public static final String CACHE_PATH = Environment.getExternalStorageDirectory() + "/ZfFiles/okCaches";
    /*超时时间-默认10秒*/
    public static final int DEFAULT_CONNECT_TIMEOUT = 300;
    public static final int DEFAULT_READ_TIMEOUT = 300;
    public static final int DEFAULT_WRITE_TIMEOUT = 30;
    /*有网情况下的本地缓存时间默认60秒*/
    public static final int DEFAULT_COOKIE_NETWORK_TIME = 0;
    /*无网络的情况下本地缓存时间默认30天*/
    public static final int DEFAULT_COOKIE_NO_NETWORK_TIME = 24 * 60 * 60 * 30;

    /**
     * 百度获取Token需要的参数
     */
    public static final String GRANT_TYPE = "client_credentials";
    public static final String CLIENT_ID = "kFrKI3D3XKVQDsaHPcq7U4ef";
    public static final String CLIENT_SECRET = "Y4SyDWa3gmx5OcEgPraDp6TQ2BK548CP";


    public static String NAME_IP_DATASTORE = "NAME_IP_DATASTORE";
    public static String KEY_IP_DATASTORE = "KEY_IP_DATASTORE";

    public static String NAME_PORT_DATASTORE = "NAME_PORT_DATASTORE";
    public static String KEY_PORT_DATASTORE = "KEY_PORT_DATASTORE";
}
